#include		<unistd.h>

#include		"list.h"
#include		"ftrace.h"

static int		find_sym_by_addr(s_sym *a, s_sym *b)
{
  return (a->addr == b->addr);
}

int			get_symbol(s_list *symlist, s_func *func)
{
  s_sym			pattern;
  s_sym			*sym;

  if (symlist)
  {
    pattern.addr = func->sym_addr;
    if ((sym = list_find(symlist, &pattern, (f_list_cmp) &find_sym_by_addr)))
    {
      func->name = sym->name;
      return (1);
    }
  }
  return (0);
}
